#include <app.h>

#define SWAP16(x)     ((((x)&0xFF) << 8) | (((x) >> 8) & 0xFF))

int main(void)
{
	unsigned int testx = 0x12345678;

	/* Dynamic initial the base of the IPs, refer to SOC doc */
	swip_call(SWIP_SOC_I2C1, SWIP_CMD_BASE, 0x80E00000, 0);

	/* Dynamic initial the base of the Devices, refer to Board Schem */
	swip_call(SWIP_MPU6050, SWIP_CMD_BASE, SWIP_SOC_I2C1, 0x68);
	
	/* load software timer default value before systick, as it drive the software timer */
    swip_call(SWIP_SOFTWARE_TIMER, SWIP_CMD_LOAD, 0, 0);

    swip_call(SWIP_SOC_SYSTICK, SWIP_CMD_ENABLE, 1000, 0);

	printf("%x\n", ((unsigned short)testx));
	printf("%x\n", SWAP16((unsigned short)testx));

    mainloop();

    return 0;
}
